package com.lzx.answer.controller;

import com.lzx.answer.entity.vo.ReportParams;
import com.lzx.answer.service.ReportService;
import com.lzx.common.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 用户举报表 前端控制器
 * </p>
 *
 * @author lzx
 * @since 2023-01-05
 */
@RestController
@RequestMapping("/answer/report")
public class ReportController {
    @Resource
    private ReportService reportService;

    //搜索
    @PostMapping("/searchReport")
    public R searchReport(@RequestBody ReportParams reportParams) {
        return reportService.searchReport(reportParams);
    }

    //获取举报列表
    @GetMapping("/getReportList/{current}/{size}")
    public R getReportList(@PathVariable int current, @PathVariable int size) {
        return reportService.getReportList(current, size);
    }

    //审核举报
    @PutMapping("/auditReport/{id}/{message}")
    public R auditReport(@PathVariable Long id, @PathVariable String message) {
        return reportService.auditReport(id, message);
    }
}
